<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background: url(images/haidengjie.jpg);
        }

        .myTitle {
            display: block;
            margin: 0 auto;
            width: 70%;
            text-align: center;
            border-style: dashed;
            border-color: rgb(0, 0, 200);
            color: blue;
            background-color: rgba(250, 235, 215, 0.4);
        }

        .formBlock {
            display: block;
            margin: 0 auto;
            width: 70%;
            border-style: dashed;
            border-color: rgb(0, 0, 200);
            color: black;
            background-color: rgba(250, 235, 215, 0.4);
        }

        label {
            display: inline-block;
            width: 100px;
            text-align: right;
            line-height: 2rem;
        }

        button {
            line-height: 2rem;
            margin-top: 0.5rem;
            margin-bottom: 0.5rem;
            margin-left: 5rem;
        }
    </style>
</head>

<body>
    <div class="myTitle">
        <h3>“海灯节”活动报名表</h3>
    </div>
    <div class="formBlock">
        <form name="myForm" action="https://httpbin.org/post" method="POST" onsubmit="formCheck()">
            <script>
                function formCheck() {
                    var form = document.forms.myForm;
                    var probability = form.probability.value;
                    if (probability >= 30) {
                        alert("咕率太高，不通过！");
                        return false;
                    }
                    return true;
                }
            </script>

            <label for="name">姓名</label>
            <input type="text" name="name" id="name" required />
            <br />

            <label>性别</label>
            <input type="radio" name="sex" required />男
            <input type="radio" name="sex" required />女
            <br />

            <label for="school">院系</label>
            <input type="text" name="school" id="school" placeholder="请输入全称" required />
            <br />

            <label for="id">学号</label>
            <input type="number" name="id" id="id" required />
            <br />

            <label for="type">学生类型</label>
            <input name="type" type="text" list="typelist" id="type" autocomplete="off" />
            <datalist id="typelist">
                <option value="本专科学生">
                <option value="硕士生">
                <option value="博士生">
            </datalist>
            <br />

            <label for="birthday">出生日期</label>
            <input type="date" name="birthday" id="birthday" required />
            <br />

            <label>参加项目</label>
            <input type="checkbox" name="selection" />烟花制作大赛
            <input type="checkbox" name="selection" />抗击魔物大赛
            <input type="checkbox" name="selection" />提瓦特全图竞速
            <input type="checkbox" name="selection" />拔河大赛
            <br />

            <label for="probability">爽约概率</label>
            <input type="range" name="probability" id="probability" />
            <br />

            <label for="email">您的邮箱</label>
            <input type="email" name="email" id="email" required />
            <br />

            <label for="phone">您的电话</label>
            <input type="number" name="phone" id="phone" required />
            <br /><br />

            <label for="notes">意见反馈</label>
            <textarea name="notes" id="notes" maxLength="1000" placeholder="输入您的宝贵建议"></textarea>
            <br />

            <button type="submit">提 交</button>
        </form>
    </div>
</body>

</html>